<script type="text/javascript">
  let p1 = new Promise((resolve, reject) => {
    resolve('1')
  })

  let p2 = new Promise((resolve, reject) => {
    // resolve('error')
  })

  let p3 = Promise.reject('失败')

  // Promise.all([p1, p2]).then((result) => {
  //   console.log("111");
  //   console.log(result)               //['成功了', 'success']
  // }).catch((error) => {
  //   console.log("222");
  //   console.log(error)
  // })
  // console.log(p1.then().then());
  Promise.all([p1,p2]).then((result) => {
    console.log(result)
  }).catch((error) => {
    console.log(error)      // 失败了，打出 '失败'
  })
  // function a()
  // {
  //   var v;
  // }
  // console.log(a());

</script>
